Cannot call an aspx file in MVC .NET 4.7.2 Web App from MVC .NET 4.7.2

iqworks Information Quality Works 296 Reputation points
2024-10-17T18:45:49.48+00:00

Hi, I have two MVC projects, MVCWebappDLL project and MVCRegularDLL project. Both in two different solutions. 

  I reference MVCWebappDLL from inside the MVCRegularDLL.

  I have an .aspx with its .aspx.cs that resides in MVCWebappDLL.

  In my MVCRegularDLL controller method, I create a new MVCWebappDLL obj.

  But I don’t know how to call the aspx file with this new MVCWebappDLL obj. 

Do in this:

  public ActionResult ShowMBStest()   {       MVCWebappDLL MVCWebappDLLobj = new MVCWebappDLL;        return Redirect("https://localhost:51712/MbsTest.aspx");      return new EmptyResult();   }

So, of course this does not work.

Here, 51712 is for the MVCRegularDLL.The port for MVCWebappDLL is 26872. 

  Thanks for any suggestions or advice

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,500 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,994 questions
{count} votes

Accepted answer
  1. Lan Huang-MSFT 29,666 Reputation points Microsoft Vendor
    2024-10-18T03:21:14.5466667+00:00

    Hi @iqworks Information Quality Works,

    You should use port 26872 instead of 51712. And you need to make sure that port 26872 is open.

    return Redirect("https://localhost:26872/MbsTest.aspx");

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,056 Reputation points
    2024-10-17T19:52:59.76+00:00

    the dll only has the .aspx code behind and controller code. the aspx files themselves need to be manually copied from the referenced project to the target project if you want to run them from the target site.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.